![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
Class for young hares (low mobility, milk and solid food inputs) More...
#include <hare_all.h>
Public Member Functions | |
virtual void | BeginStep (void) |
BeginStep for Hare_Young. More... | |
virtual void | Step (void) |
Step code for Hare_Young. More... | |
virtual void | EndStep (void) |
EndStep code for Hare_Young. More... | |
Hare_Young (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight) | |
Constructor for Hare_Young. More... | |
void | ReInit (struct_Hare a_data) |
Young object reinitiation. More... | |
void | Init (double p_weight) |
Object initiation. More... | |
virtual | ~Hare_Young () |
Destructor for Hare_Young. More... | |
virtual void | ON_Dead () |
This hare has been killed. More... | |
![]() | |
Hare_Infant (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM) | |
Hare infant constructor. More... | |
void | ReInit (struct_Hare a_data) |
Infant object reinitiation. More... | |
void | Init () |
Object initiation. More... | |
virtual | ~Hare_Infant () |
Hare infant destructor. More... | |
void | ON_BeingFed (double a_someMilk) |
Get energy from milk given. More... | |
void | SetWeight (double w) |
Set the weight. More... | |
void | SetMum (Hare_Female *a_af) |
Set the mother pointer. More... | |
![]() | |
THare (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM) | |
Constructor. More... | |
void | THareInit (int p_x, int p_y, THare_Population_Manager *p_PPM) |
Object Initiation. More... | |
virtual | ~THare () |
Destructor. More... | |
double | GetWeight () |
double | GetTotalWeight () |
Provide the wet weight of the hare. More... | |
int | GetAge () |
void | ON_MumDead (Hare_Female *a_Mum) |
Inform Mum that we are dead. More... | |
void | SetMum (Hare_Female *) |
Set the mother pointer. Reimplemented in Hare_Infant. More... | |
Hare_Female * | GetMum () |
Get the mother pointer. More... | |
double | GetRMR () |
Get todays RMR. More... | |
virtual bool | WasPredated () |
Test for predation. More... | |
int | GetRefNum () |
Get the refnum for this hare. More... | |
void | loadVegPalatability (void) |
Loads static member m_vegPalatability with data. More... | |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual int | WhatState () |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Protected Member Functions | |
TTypeOfHareState | st_Developing () |
Developmental code for the young hare. More... | |
TTypeOfHareState | st_Dispersal () |
Not used. More... | |
TTypeOfHareState | st_Foraging () |
Young foraging. More... | |
void | st_NextStage () |
Maturation to Hare_Juvenile. More... | |
TTypeOfHareState | st_Resting () |
Resting. More... | |
bool | OnFarmEvent (FarmToDo event) |
Response to farm actions. More... | |
![]() | |
TTypeOfHareState | st_Developing () |
Developmental behaviour for the infant hare. More... | |
void | st_NextStage () |
'mature' to become a young More... | |
![]() | |
bool | Run (int a_dist, int a_direction) |
Run a distance in a direction. More... | |
void | EnergyBalance (TTypeOfActivity a_activity, int dist) |
Adjust energy balance for an activity. More... | |
void | TimeBudget (TTypeOfActivity a_activity, int dist) |
Adjust time budger for an activity. More... | |
void | st_Dying () |
Tidy up before removing the object on death. More... | |
virtual void | Running (int a_max_dist) |
Run. More... | |
void | Walking (int a_dist, int a_direction) |
Walking. More... | |
double | Forage (int &time) |
Foraging. More... | |
double | ForageP (int &time) |
Foraging but also incorporating pesticide exposure. More... | |
virtual void | InternalPesticideHandlingAndResponse () |
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
virtual void | GeneralEndocrineDisruptor (double) |
Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
virtual void | GeneralOrganoPhosphate (double) |
Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
double | ForageSquare (int a_x, int a_y) |
Forage from an area. More... | |
double | ForageSquareP (int a_x, int a_y, double *a_pestexposure) |
Forage from an area and resturn pesticide exposure as well as food. More... | |
int | GetPegDistance () |
Get peg distance. More... | |
int | GetPegPull () |
Get attractive force of peg. More... | |
int | GetPegDirection () |
Get direction of peg. More... | |
void | MovePeg () |
Move the peg according to attraction forces. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Additional Inherited Members | |
![]() | |
static double * | m_vegPalatability = NULL |
Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetation can be specified here. More... | |
![]() | |
TTypeOfHareState | m_CurrentHState |
Defines the current activity. More... | |
int | m_Age |
State variale - hare age. More... | |
Hare_Object | m_Type |
State variale - the type of hare. More... | |
double | m_weight |
State variale - hare weight g. More... | |
double | m_old_weight |
State variale - last hare weight. More... | |
Hare_Female * | m_MyMum |
Pointer to the hare's mum. More... | |
THare_Population_Manager * | m_OurPopulationManager |
Pointer to the hare population manager. More... | |
int | m_Lifespan |
Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More... | |
int | m_ActivityTime |
Minutes of potential activity time per day. More... | |
int | m_StarvationDays |
State variable - the number of consecutive days in negative energy balance. More... | |
double | m_fatReserve |
State variable - the energy reserve of the hare. More... | |
double | m_TodaysEnergy |
State variable - the amount of energy available today, can be in deficit. More... | |
double | m_EnergyMax |
State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More... | |
double | m_KJRunning |
KJ/m cost of running per kg hare. More... | |
double | m_KJWalking |
KJ/m cost of walking per kg hare. More... | |
double | m_KJForaging |
KJ/m cost of foraging per kg hare. More... | |
double | m_SpeedRunning |
m/min speed of running per kg hare More... | |
double | m_SpeedWalking |
m/min speed of walking per kg hare More... | |
double | m_foragingenergy |
Energy obtained from foraging/feeding. More... | |
int | m_peg_x |
peg x-coordinate More... | |
int | m_peg_y |
peg y-coordinate More... | |
int | m_RefNum |
Unique hare reference number, also functions as sex flag. More... | |
int | m_experiencedDensity |
State variable used in alternative density-dependent configurations. More... | |
int | m_lastYearsDensity |
State variable used in alternative density-dependent configurations. More... | |
int | m_ddindex |
State variable used in alternative density-dependent configurations. More... | |
int | m_expDensity [365] |
State variable used in alternative density-dependent configurations. More... | |
int | m_DensitySum |
State variable used in alternative density-dependent configurations. More... | |
bool | m_IamSick |
flag for sickness - used in conjunction with disease configurations More... | |
double | m_pesticide_burden |
State variable used to hold the current body-burden of pesticide. More... | |
double | m_pesticidedegradationrate |
State variable used to hold the daily degredation rate of the pesticide in the body. More... | |
bool | m_pesticideInfluenced1 |
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
Class for young hares (low mobility, milk and solid food inputs)
Hare_Young::Hare_Young | ( | int | p_x, |
int | p_y, | ||
Landscape * | p_L, | ||
THare_Population_Manager * | p_PPM, | ||
double | p_weight | ||
) |
Constructor for Hare_Young.
References Hare_Infant::Init().
|
virtual |
Destructor for Hare_Young.
|
virtual |
BeginStep for Hare_Young.
Resets the day's activity counter and checks for default mortalities and potentially extra mortalities. Calculates energy usage for movement based on todays weight
Reimplemented from Hare_Infant.
References cfg_hare_escape_dist, cfg_hare_proximity_alert, cfg_MaxEnergyIntakeScaler, TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetInterference(), THare_Population_Manager::GetKJperM(), THare::GetRMR(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, TALMaSSObject::m_CurrentStateNo, THare::m_EnergyMax, THare_Population_Manager::m_HareThresholdDD, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_old_weight, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, THare_Population_Manager::m_YoungMortRate, ON_Dead(), THare::Running(), CfgInt::value(), and CfgFloat::value().
|
virtual |
EndStep code for Hare_Young.
NB development must be called here because they hares may be still getting milk from Mum.
In EndStep, the home-range centre peg gravitates a little way towards the daily activity area for today.
Reimplemented from Hare_Infant.
References cfg_hare_pesticideresponse_on, THare::InternalPesticideHandlingAndResponse(), THare::m_CurrentHState, THare::MovePeg(), ON_Dead(), st_Developing(), tohs_Developing, tohs_Dying, and CfgBool::value().
void Hare_Young::Init | ( | double | p_weight | ) |
|
virtual |
This hare has been killed.
Housekeeping for removal of the object, lets Mum know if there is a Mum
Reimplemented from Hare_Infant.
References THare::st_Dying().
Referenced by BeginStep(), EndStep(), and OnFarmEvent().
|
protectedvirtual |
Response to farm actions.
Checks to see if any nasty farm event has caused the death of the infant.
Currently there is only one response to those events where death is possible. However, this may not always be the case so the code is structured as for the other ALMaSS animals (i.e. it could be a bit easier to overview if it were written differently).
Reimplemented from Hare_Infant.
References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, bed_forming, biocide, bulb_harvest, burn_straw_stubble, cattle_out, cattle_out_low, cfg_hare_y_cut, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_calcium, fa_greenmanure, fa_manganesesulphate, fa_manure, fa_npk, fa_npks, fa_pk, fa_rsm, fa_sludge, fa_slurry, flower_cutting, fp_ammoniumsulphate, fp_calcium, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_rsm, fp_sludge, fp_slurry, fungicide_treat, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, molluscicide, mow, ON_Dead(), pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, random(), row_cultivation, shallow_harrow, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgInt::value(), Landscape::Warn(), water, and winter_plough.
void Hare_Young::ReInit | ( | struct_Hare | a_data | ) |
Young object reinitiation.
References struct_Hare::HM, Hare_Infant::Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::THareInit(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.
Referenced by THare_Population_Manager::CreateObjects().
|
protected |
Developmental code for the young hare.
References cfg_young_starvation_threshold, THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare::m_Age, THare::m_old_weight, THare::m_OurPopulationManager, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, tohs_Dying, tohs_Foraging, tohs_NextStage, and CfgInt::value().
Referenced by EndStep().
|
protectedvirtual |
Not used.
Unused at present
Reimplemented from THare.
References tohs_Foraging.
Referenced by Step().
|
protected |
Young foraging.
The amount of time spent on this is dependent upon age. They can take in food up to a proportion of their needs increasing with age. This gives us a little problem because we don't explicitly define their needs. We assume therefore that the milk supply is maximal and that the the time available is all day - but that the max solid food intake possible is defined by age, following the data from Hacklander - this gives no flexibility in the proportion of max food but will cause differential growth w.r.t. milk supply.
References activity_Foraging, cfg_ForageRestingRatio, cfg_hare_pesticideresponse_on, THare::Forage(), THare::ForageP(), g_MaxLeveretGrowthEnergy, g_PropSolidFood, THare_Population_Manager::GetRMR(), THare::GetTotalWeight(), THare::m_ActivityTime, THare::m_Age, THare::m_OurPopulationManager, THare::m_TodaysEnergy, THare::TimeBudget(), tohs_Resting, CfgFloat::value(), and CfgBool::value().
Referenced by Step().
|
protected |
Maturation to Hare_Juvenile.
Young 'matures' to become a Hare_Juvenile.
This creats a Hare_Juvenile object via a call to create objects, then sets the flag for destruction of this object.
References THare_Population_Manager::CreateObjects(), struct_Hare::HM, struct_Hare::L, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_weight, Hare_Female::ON_RemoveYoung(), tohs_DestroyObject, struct_Hare::weight, struct_Hare::x, and struct_Hare::y.
Referenced by Step().
|
protected |
Resting.
Just uses some time and energy sitting around. The time used is important because it removes time for foraging.
References activity_Resting, THare::EnergyBalance(), THare::m_ActivityTime, THare::TimeBudget(), and tohs_Developing.
Referenced by Step().
|
virtual |
Step code for Hare_Young.
Reimplemented from Hare_Infant.
References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Dispersal(), st_Foraging(), st_NextStage(), st_Resting(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_NextStage, tohs_Resting, and Landscape::Warn().